/**
 * 主、子多线程
 */
use std::{thread, thread::spawn, time::Duration};

pub fn run() {
   let handler = spawn(||{
        for i in 1..10 {
            println!("child thread {} start", i);
            thread::sleep(Duration::from_millis(1000));
        }
    });
    for i in 1..5 {
        println!("main thread {} start", i);
        thread::sleep(Duration::from_millis(1000));
    }
    handler.join().unwrap();
}
